// set-neutralino-url.js
const fs = require('fs');
const path = require('path');

const configPath = path.join(__dirname, 'neutralinojs', 'neutralino.config.json');
const mode = process.argv[2]; // 'dev' or 'prod'

const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
if (mode === 'dev') {
  config.url = 'http://localhost:5173/';
} else {
  config.url = '/';
}
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
console.log(`Set neutralino.config.json url to: ${config.url}`);